#ifndef PTITLEBAR_H
#define PTITLEBAR_H

#include <QFrame>
#include <QPixmap>
#include <QLabel>
#include <QFont>
#include <QHBoxLayout>
#include <QSpacerItem>
#include "pstyledbutton.h"

/**
A custom made titlebar to be used with dialogs in which a custom look is desired.

	@author Daniel Kish <d.kish@pripares.com>
*/
class PTitleBar : public QFrame
{
Q_OBJECT
 Q_PROPERTY(QPixmap minPixmap READ getMinimizePixmap WRITE setMinimizePixmap DESIGNABLE true)
 Q_PROPERTY(QPixmap maxPixmap READ getMaximizePixmap WRITE setMaximizePixmap DESIGNABLE true)
 Q_PROPERTY(QPixmap closePixmap READ getClosePixmap WRITE setClosePixmap DESIGNABLE true)
 Q_PROPERTY(QPixmap titlePixmap READ getTitlePixmap WRITE setTitlePixmap DESIGNABLE true)
 Q_PROPERTY(QString titleString READ  getTitleString WRITE setTitleString DESIGNABLE true)
private:
 QHBoxLayout *m_hboxLayout;
 QSpacerItem *m_spacerItem;
 QPixmap minPixmap,
         maxPixmap,
         closePixmap,
         titlePixmap;
 QString titleString;         
 PStyledButton *m_btnMin,
               *m_btnMax,
               *m_btnClose;
 QLabel *lblTitle;
 QFont titleFont;
public:
    PTitleBar(QWidget *parent = 0);

    ~PTitleBar();
     QPixmap getMinimizePixmap(int state=0);
     QPixmap   getMaximizePixmap(int state=0);
     QPixmap   getClosePixmap(int state=0);
     QPixmap   getTitlePixmap();
     QString   getTitleString();
    QFont & getTitleFont();
   
    

public slots:
    void setMinimizePixmap(QPixmap pixmap,int state=0);
    void setMaximizePixmap(QPixmap pixmap,int state=0);
    void setClosePixmap(QPixmap pixmap,int state=0);
    void setTitlePixmap(QPixmap pixmap);
    void setTitleString(QString title);
    void restoreParent();
    void closeParent();
    void minimizeParent();
    
    
signals:
    void sig_minimize();
    void sig_close();
    void sig_restore();
     void sig_maximize();
};

#endif
